
export default function(){
    const provMap={
        '9A':'基地', '10':'内蒙古', '11':'北京', '13':'天津', '17':'山东', '18':'河北', '19':'山西', '22':'澳门',
        '30':'安徽', '31':'上海', '34':'江苏', '36':'浙江', '38':'福建', '50':'海南', '51':'广东', '59':'广西',
        '70':'青海', '71':'湖北', '74':'湖南', '75':'江西', '76':'河南', '79':'西藏', '81':'四川', '83':'重庆',
        '84':'陕西', '85':'贵州', '86':'云南', '87':'甘肃', '88':'宁夏', '89':'新疆', '90':'吉林', '91':'辽宁', '97':'黑龙江',
    }
    const userTypeMap={
        '0':'游客',
        '1':'渠道商',
        '2':'店铺',
        '3':'LT人员',
        '4':'平台管理员',
        '5':'省客服',
    }
    const searchType={
        '0':'商品',
        '1':'店铺',
    }
    const shopTypeMap={
        '0':'华盛全国店',
        '1':'华盛省分店',
        '2':'联通自营店',
        '3':'合作方全国店',
        '4':'合作方省分店',
        '5':'厂家直供店',
        '6':'省包分销商',
    }
    /**
     * 订单类型定义
     */
    const ordStatusMap={
        '01': '待付款',
        '02': '待发货',
        '05': '待收货',
        '06': '交易成功',
        '40': '退款/售后',
        '50': '待寄回',
        '60': '售后中',
        '99': '交易关闭',
    }

    /**
     * 订单来源定义
     */
    const orderFromMap={
        '0': '泛智平台',
        '1': '撮合系统',
        '2': '优品小店',
        '3': '京东',
    }

    const transProv = (key:string):any =>{
        return provMap[key as keyof typeof provMap]||''
    }
    const transUserType = (key:string):any =>{
        return userTypeMap[key as keyof typeof userTypeMap]||''
    }
    const transShopType = (key:string):any =>{
        return shopTypeMap[key as keyof typeof shopTypeMap]||''
    }
    const getSearchTypeList = ():any[] =>{
        let list = []
        for( const k in searchType){
            if(searchType.hasOwnProperty(k)){
                let name = searchType[k as keyof typeof searchType]
                list.push({
                    typeName: name,
                    typeValue: k,
                    placeholder:'请输入'+name+'关键字'
                })
            }

        }
        return list
    }
    return {
        provMap, userTypeMap, searchType, shopTypeMap, ordStatusMap, orderFromMap,
        transProv,transUserType,transShopType,getSearchTypeList,
    }

}